package com.example.shop_2304.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.CouponEntityItem
import com.example.shop_2304.R

class CouponAdapter:BaseQuickAdapter<CouponEntityItem,BaseViewHolder>(R.layout.item_coupon) {
    override fun convert(holder: BaseViewHolder, item: CouponEntityItem) {
        holder.setText(R.id.coupon_money,"￥${item.money}")
        holder.setText(R.id.coupon_minprice,"满${item.minPrice}元可用")
        if(item.isUse){//是否已领取位使用    领取了
            holder.setText(R.id.coupon_tv,"已领取")
        }else{
            holder.setText(R.id.coupon_tv,"领取")
        }
        //holder.getView<TextView>(R.id.coupon_tv).text = if(item.isUse) "已领取" else "领取"
    }
}